<?php

namespace Admin\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\Authentication\AuthenticationService;
use Zend\Authentication\Storage\Session as SessionStorage;
use Zend\Permissions\Acl\Resource\GenericResource as Resource;
use Zend\Permissions\Acl\Role\GenericRole as Role;
use Zend\Permissions\Acl\Acl;

class MyController extends AbstractActionController {
	
	protected $authUser = null;

	public function init() {
		if(!$this->zfcUserAuthentification()->hasIdentity()) {
			$this->plugin('redirect')->toRoute('user', array('action'=>'logout'));
		} else {
			$this->authUser = $this->zfcUserAuthentification()->getIdentity();
		}

	}
	
	public function zfcUserAuthentification() {
		$sm = $this->getServiceLocator();
		return $sm->get('zfcuser_auth_service');
	}


}